package model

import "github.com/hwcer/updater"

func init() {
	Register(&EggPool{})
}

type EggPool struct {
	Model  `bson:"inline"`
	Values map[int32]int32 `bson:"values" json:"-"  `
}

// TableName 数据库表名
func (this *EggPool) TableName() string {
	return "EggPool"
}

func (this *EggPool) SetOnInsert() (map[string]any, error) {
	r := map[string]any{}
	r["uid"] = this.Uid
	r["iid"] = this.IID
	return r, nil
}

func NewEggPool(u *updater.Updater, iid int32) *EggPool {
	r := &EggPool{}
	r.Model.Init(u, iid)
	r.OID = Unique(u, iid)
	r.Values = make(map[int32]int32)
	return r

}
